<!-- MAIN CONTENT -->
<div id="content">
    <!--头部-->
    <div smart-include="sensor/views/sub-header.tpl.html"></div>
    <!--头部end-->
        <div class="row">
            <div class="col-lg-3 col-md-4 col-sm-4 col-xs-12 chartpadd">
                <!--<div class="col-lg-12 col-md-12 margin-bottom-10">
                    <a class="btn btn-labeled btn-primary" data-toggle="modal" data-target="#addModal" ng-click="show_addbox()"> <span class="btn-label"><i class="glyphicon glyphicon-plus"></i></span>添加方案</a>
                </div>-->
                <div class="col-lg-12 col-md-12 col-sm-12">
                    <div class="table-responsive">
                        <table class="table table-bordered table-hover no-margin font-sml table-striped sensor_table">
                            <thead>
                                <tr>
                                    <th style="width: 35%">操作</th>
                                    <th class="text-align-center">方案名称</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ng-repeat="data in types">
                                    <td>
                                        <button class='btn btn-xs btn-default bbb bbb{{data.id}}' uib-tooltip='编辑' tooltip-append-to-body='true' data-toggle="modal" data-target="#editAlert" ng-click="Edit_pro(data)"><i class='fa fa-pencil'></i></button>
                                        <button class='btn btn-xs btn-default' uib-tooltip='删除' tooltip-append-to-body='true' data-toggle="modal" data-target="#delAlert" ng-click="showDelDialog(data.id)"><i class='fa fa-times'></i></button>
                                        <button class='btn btn-xs btn-default' uib-tooltip='查看' tooltip-append-to-body='true' ui-sref="app.sensor.watchcharts"><i class='fa fa-eye'></i></button>
                                    </td>
                                    <td class="text-align-center">{{data.name}}</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="dt-toolbar-footer">
                        <tm-pagination conf="paginationConf"></tm-pagination>
                    </div>
                </div>
            </div>
            <div class="col-lg-9 col-md-8 col-sm-8 col-xs-12 chartpadd">
                <div class="row">
                    <div class="col-lg-12 col-md-12 col-sm-12 margin-bottom-10" id="planName">
                        <form class="form-horizontal">
                            <div class="col-lg-2 col-md-4 col-sm-4 col-xs-6">
                                <input type="text" ng-model="addobj.name" class="form-control" placeholder="方案名称" />
                            </div>
                        </form>
                        <!--保存方案-->
                        <button class=" btn editplan btn-primary" disabled ng-click="sure_edit()">
                            修改方案
                        </button>
                        <!--增加方案-->
                        <button class=" btn sureplan btn-primary" ng-click="addPlan(id)">
                            增加方案
                        </button>
                    </div>
                    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        <!-- NEW WIDGET START -->
                        <article class="col-xs-12 col-sm-12 col-md-12 col-lg-6">
                            <!-- Widget ID (each widget will need unique ID)-->
                            <div class="jarviswidget" id="wid-id-0" data-widget-editbutton="false">
                                <header>
                                    <span class="widget-icon pull-left"> <i class="fa fa-bar-chart-o"></i> </span>
                                    <p class="chartp">请选择字段</p>
                                    <h2>
                                        <div id="linefield">
                                            <select class="form-control" ng-model="editdata.line">
                                                <option class="role" value="">无</option>
                                                <option class="role" ng-repeat="field in fields" value="{{field.id}}">{{field.name}}</option>
                                            </select>
                                        </div>
                                    </h2>
                                </header>
                                <!-- widget div-->
                                <div>
                                    <!-- widget edit box -->
                                    <div class="jarviswidget-editbox">
                                        <!-- This area used as dropdown edit box -->
                                    </div>
                                    <!-- end widget edit box -->
                                    <!-- widget content -->
                                    <div class="widget-body no-padding">
                                        <div id="bar-chart">
                                            <div id="line_box">
                                                <div style="width:100%;height:300%" id="line"></div>
                                            </div>
                                        </div>
                                    </div>
                                    <!-- end widget content -->
                                </div>
                                <!-- end widget div -->
                            </div>
                            <!-- end widget -->
                            <!-- Widget ID (each widget will need unique ID)-->
                        </article>
                        <!-- WIDGET END -->
                        <article class="col-xs-12 col-sm-12 col-md-12 col-lg-6">
                            <!-- Widget ID (each widget will need unique ID)-->
                            <div class="jarviswidget" id="wid-id-0" data-widget-editbutton="false">
                                <header>
                                    <span class="widget-icon"> <i class="fa fa-bar-chart-o"></i> </span>
                                    <p class="chartp">请选择字段</p>
                                    <h2>
                                        <div id="barfield">
                                            <select class="form-control" ng-model="editdata.bar">
                                                <option class="role" value="">无</option>
                                                <option class="role" ng-repeat="field in fields" value="{{field.id}}">{{field.name}}</option>
                                            </select>
                                        </div>
                                    </h2>
                                </header>
                                <!-- widget div-->
                                <div>
                                    <!-- widget edit box -->
                                    <div class="jarviswidget-editbox">
                                        <!-- This area used as dropdown edit box -->
                                    </div>
                                    <!-- end widget edit box -->
                                    <!-- widget content -->
                                    <div class="widget-body no-padding">
                                        <div id="bar-chart" class="">
                                            <div id="bar_box">
                                                <div style="width:100%;height:300%" id="bar"></div>
                                            </div>
                                        </div>
                                    </div>
                                    <!-- end widget content -->
                                </div>
                                <!-- end widget div -->
                            </div>
                            <!-- end widget -->
                            <!-- Widget ID (each widget will need unique ID)-->
                        </article>
                        <!-- WIDGET END -->
                        <article class="col-xs-12 col-sm-12 col-md-12 col-lg-6">
                            <!-- Widget ID (each widget will need unique ID)-->
                            <div class="jarviswidget" id="wid-id-0" data-widget-editbutton="false">
                                <header>
                                    <span class="widget-icon"> <i class="fa fa-bar-chart-o"></i></span>
                                    <p class="chartp">请选择字段</p>
                                    <h2>
                                        <div id="piefield">
                                            <select class="form-control" ng-model="editdata.pie">
                                                <option class="role" value="">无</option>
                                                <option class="role" ng-repeat="field in fields" value="{{field.id}}">{{field.name}}</option>
                                            </select>
                                        </div>
                                    </h2>
                                </header>
                                <!-- widget div-->
                                <div>
                                    <!-- widget edit box -->
                                    <div class="jarviswidget-editbox">
                                        <!-- This area used as dropdown edit box -->
                                    </div>
                                    <!-- end widget edit box -->
                                    <!-- widget content -->
                                    <div class="widget-body no-padding">
                                        <div id="bar-chart">
                                            <div id="pie_box">
                                                <div style="width:100%;height:300%" id="pie"></div>
                                            </div>
                                        </div>
                                    </div>
                                    <!-- end widget content -->
                                </div>
                                <!-- end widget div -->
                            </div>
                            <!-- end widget -->
                            <!-- Widget ID (each widget will need unique ID)-->
                        </article>
                        <!-- WIDGET END -->
                    </div>
                </div>
            </div>
        </div>  
    <div class="modal fade in" id="delAlert" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        ×
                    </button>
                    <h4 class="modal-title">信息</h4>
                </div>
                <div class="modal-body">
                    <p>
                        您确实要删除这条数据吗？
                    </p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">
                        关闭
                    </button>
                    <button type="button" class="btn btn-primary" ng-click="sure_del()">
                        确认
                    </button>
                </div>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
    <!-- end widget grid -->
</div>
<!-- END MAIN CONTENT -->
<script>
    var pagefunction = function () {
        // START AND FINISH DATE
        $('#startdate').datepicker({
            //dateFormat : 'dd.mm.yy',
            dateFormat: 'yy-mm-dd',
            prevText: '<i class="fa fa-chevron-left"></i>',
            nextText: '<i class="fa fa-chevron-right"></i>',
            monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
            dayNames: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
            dayNamesShort: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
            dayNamesMin: ['日', '一', '二', '三', '四', '五', '六'],
            onSelect: function (selectedDate) {
                $('#finishdate').datepicker('option', 'minDate', selectedDate);
            }
        });
    };
    pagefunction();
</script>